home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 568 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  3.2 KB

  1. Subject: Re: pipes & ptys
  2. Date: Wed, 20 Oct 93 22:56:08 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <9310200039.AA03420@pirol.techfak.uni-bielefeld.de>; from "itschere@TechFak.Uni-Bielefeld.DE" at Oct 20, 93 1:39 am
  5. Message-Id: <9310202156.AA00230@jelal.north.de>
  6.  
  7. itschere@TechFak.Uni-Bielefeld.DE writes:
  8. > Juergen Lock
  9. > > 
  10. > > > Well, what else can I do in a Program like a window manager, if I've
  11. > > > got to look for every char?
  12. > > 
  13. > >  well Eric said that already but in different words... :)  a 1k RAW
  14. > > read() does not block until it has read 1k, only until _some_ data is
  15. > > available. (pty master reads are always RAW)  if it receives 200 bytes
  16. > > (i.e. pty slave write()s 200 bytes) it returns 200 bytes, if data comes
  17. > > in 1-byte-at-a-time it reads 1 byte, or whatever has accumulated in the
  18. > > buffer (pipe) since the last read.
  19. > > 
  20. > >  so look at each char does not mean you need one system call for each
  21. > > char...
  22. > Ok, got this, but: (see my other mail) it will return as soon as ther is
  23. > some data, say, when it get's its next time slice, which is 16ms long on
  24. > my 60Hz TT-VBL, right? Now I estimate that the writer (if really (worst case,
  25. > of course, but that's what counts.)) using 1 bytes I/O, doesn't manage
  26. > to output more than something like 30 chars per timeslice, so 60 slices
  27. > a 30 bytes (always completely ignoring the time I need to read the data),~
  28.  
  29.  this is the time we're trying to improve...
  30.  
  31. > makes 1800 CPS, and that looks like the number I've measured.
  32.  
  33.  how much cps does the writer get when you send it to /dev/null
  34. instead?  the difference between that and your 1800 is the only thing
  35. we can improve here of course... for more the writing program has to
  36. use longer writes.
  37. > > >   Point is that system calling overhead is soooo big that it doesn't matter
  38. > > > a lot if the pipefs has got to do 1 or 4 bytes read.
  39. > > 
  40. > >  yes but it doesn't... have to do single-char IO.  and when you have
  41. > > larger read/writes this character shuffling can cause overhead of
  42. > > n times the size of the actual device IO.
  43. > Perhaps we can start a personal dispute about this, but so far I heavily
  44. > doubt this. Sorry, no proofs so far... :-(
  45. > > type            read    write    speed (CPS)    % CPU load (top)
  46. > > -----------------------------------------------------------
  47. > > pipe            4096    4096    270000
  48. > > pty            4096    4096    a bit less
  49. > > 
  50. > >  pty output would get nearly as fast as the pipe, and serial ports could
  51. > > run full speed and no longer eat up all available cycles...
  52. > If a) you really use big chunks and b) modems are operated by interrupt...
  53.  
  54.  yup!  actually modems are operated by interrupts already, only
  55. the buffer status is still polled and data is read/written
  56. one-byte-at-a-time...
  57. > > >  At least at my setup the involved device
  58. > > > drivers can easily be fixed.
  59. > > 
  60. > >  hmm how do you mean that?
  61. > Well, to make the biosfs drives expect char pointers instead longs. None
  62. > of my program _seems_ to complain about this. But obviously that's no
  63. > compatible solution... ;-)
  64.  
  65.  and i guess none of your programs use scan codes...
  66.  
  67.  :-)
  68.     Juergen
  69. -- 
  70. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  71.                                 ...ohne Gewehr
  72. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  73.